<?php
session_start();
      if (isset($_SESSION['k_username'])) {
?>
<html>
<head>
<title >Socios</title>
<style type="text/css">
<!--
.Estilo1 {font-size: 24px}
-->
</style>
<link rel="stylesheet" href="../../css/style1.css" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php
    include('../../conexion.inc.php');
  $link = Conectarse();

mysql_select_db("gotica_sociosgotica",$link);
?>

<div align="center" class="Estilo1">SOCIOS QUE CUMPLEN AÑOS EL MES SIGUIENTE</div>

<?php 
if($_SESSION['grupo']==1){
echo "<form method=\"post\" action=\"../../exportexcel.php\">";
echo "<input type=\"hidden\" name=\"num\" value=\"7\" />";
echo "<input type=\"submit\" value=\"Exportar a Excel\" />";
echo "</form>";}
?>
<table  width="100%" border="0" cellspacing="2" cellpadding="2" align="center">
<tr align="center" class="dataheader" >
<td></td>
<td></td>
<td>Nº</td>
<td>Nombres</td>
<td>Apellidos</td>
<td>DNI</td>
<td>Direccion</td>
<td>Email</td>
<td>Distrito</td>
<td>Fecha Ingreso</td>
<td>Fecha Renovacion</td>
<td>Renovo</td>
<td>Clase</td>
<td>Pago</td>
<td>Tipo Socio</td>
<td>Fecha Nacimiento</td>
<td>Telefono</td>
<td>Celular</td>
<td>Sexo</td>
<td>Modificado Por</td>
<td>Fecha Modificacion</td>

</tr>
<?php
$mes = date("m")+1;
$sql = "SELECT * FROM socios WHERE month(FechaNacimiento)=".$mes." ORDER BY day(FechaNacimiento) ASC";;
$result = mysql_query($sql, $link);
$cont=0;
while ($row = mysql_fetch_array($result))
{
	$cont++;
	//CREATED BY DIEGO TOVAR :D
echo"<tr align=\"center\" class=\"data\">";
echo "<form method=\"post\" action=\"borrasocio.php\">";
echo "<input type=\"hidden\" value=".$row['idsocio']." name=\"valor\" />";
echo "<td><input type=\"submit\" class=\"buttonmi\"  name=\"borrar\" value=\"Borrar\" /></td>";
echo "</form>";
echo "<form method=\"post\" action=\"edicionsocio.php\">";
echo "<input type=\"hidden\" value=".$row['idsocio']." name=\"valor\" />";
echo "<td><input type=\"submit\" class=\"buttonmi\"  name=\"edit\" value=\"Editar\" /></td>";
echo "</form>";
echo "<td>".$cont."</td>";
echo "<td>".$row['Nombres']."</td>";
echo "<td>".$row['ApPaterno']." ".$row['ApMaterno']."</td>";
echo "<td>".$row['DNI']."</td>";
echo "<td>".$row['Direccion']."</td>";
echo "<td>".$row['Email']."</td>";
$sql2= "Select Distrito FROM distrito where IdDistrit=".$row['IdDistrito'];
$result2 = mysql_query($sql2, $link);
$row2= mysql_fetch_array($result2);
echo "<td>".$row2['Distrito']."</td>";
echo "<td>".$row['FechaIngreso']."</td>";
echo "<td>".$row['FechaRenovacion']."</td>";
if($row['Renovo']==1){
echo "<td>Si</td>";}else
{echo "<td>No</td>";}

$sql3= "Select Clase FROM clase where Idclase=".$row['IdClase'];
$result3 = mysql_query($sql3, $link);
$row3= mysql_fetch_array($result3);
echo "<td>".$row3['Clase']."</td>";
echo "<td>".$row['Pago']."</td>";
echo "<td>";
$sqlst= "Select idtiposocio FROM socio_tiposocio where idsocio=".$row['idsocio'];
$resultst = mysql_query($sqlst, $link);
while($rowst= mysql_fetch_array($resultst)){
$sql4= "Select TipoSocio FROM tiposocio where idTipoSocio=".$rowst['idtiposocio'];
$result4 = mysql_query($sql4, $link);
$row4= mysql_fetch_array($result4);
echo $row4['TipoSocio']."\n" ;}
echo "</td>";
echo "<td>".$row['FechaNacimiento']."</td>";
echo "<td>".$row['Telefono']."</td>";
echo "<td>".$row['Celular']."</td>";
echo "<td>".$row['IdSexo']."</td>";
echo "<td>".$row['editadopor']."</td>";
echo "<td>".$row['edicion']."</td>";
echo"</tr>";
}
?>
</table>
</body>
</html>
<?
}else
{
	echo "<SCRIPT LANGUAGE=\"javascript\">";
echo "location.href = \"index.php\"";
echo "</SCRIPT>";
	}
?>